<template>
	<view class="news-detail">
		  <text  class="title">{{detail.title}}</text>
		   <view class="info">
		   	  <text>发表时间：{{detail.add_time  | formateDate}}</text>
			  <text>浏览：{{detail.click}}</text>
		   </view>
		   <view   class="content">
			   <!-- nodes	Array / String  -->
			      <rich-text  :nodes="detail.content"></rich-text>
		   </view>
	</view>
</template>

<script>
	
	export  default{
		data(){
			return{
				id:0,
				detail:{}
			}
		},
		  methods:{
			  //6、获取d单条资讯详情api
			
			  async  getNewDetail(){
				
				  const  res = await this.$myRequest({
					  url:`/api/getnew/${this.id}`
					  /* url:'/api/getnew/'+  this.id */
				  })
				  
				  this.detail = res.data.message[0]
			  }
		  },
		onLoad(option) {
			
			 this.id = option.id
			 this.getNewDetail()
		}
	}
</script>

<style   lang="scss" scoped>
page{
	height: 100%;
	.news-detail{
		height: 100%;
		font-size: 30rpx;
		padding: 0 20rpx;
		.title{
			text-align: center;
			width:710rpx ;
			display: block;
			margin: 20rpx  0;
			color: $shop-color;
		}
		.info{
			display: flex;
			justify-content: space-between;
		}
	}
}
	
</style>